From: Florian Müllner Date: Fri, 19 Jan 2024 13:01:27 +0000 (+0100) Subject: panel: Use connectObject() for overview signals X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~2^2~126 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=29ba8ab03c16fc9359e3c6c765d67a6d5c4bf718;p=gnome-shell.git panel: Use connectObject() for overview signals We expect top bar and activities button to be around for the entire duration of the session, but some extra caution doesn't hurt. Part-of: --- diff --git a/js/ui/panel.js b/js/ui/panel.js index 7318e95f0..0309aa1a4 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -427,12 +427,12 @@ class ActivitiesButton extends PanelMenu.Button { this.add_child(new WorkspaceIndicators()); - Main.overview.connect('showing', () => { - this.add_style_pseudo_class('checked'); - }); - Main.overview.connect('hiding', () => { - this.remove_style_pseudo_class('checked'); - }); + Main.overview.connectObject('showing', + () => this.add_style_pseudo_class('checked'), + this); + Main.overview.connectObject('hiding', + () => this.remove_style_pseudo_class('checked'), + this); this._xdndTimeOut = 0; } @@ -668,12 +668,12 @@ class Panel extends St.Widget { this.connect('button-press-event', this._onButtonPress.bind(this)); this.connect('touch-event', this._onTouchEvent.bind(this)); - Main.overview.connect('showing', () => { - this.add_style_pseudo_class('overview'); - }); - Main.overview.connect('hiding', () => { - this.remove_style_pseudo_class('overview'); - }); + Main.overview.connectObject('showing', + () => this.add_style_pseudo_class('overview'), + this); + Main.overview.connect('hiding', + () => this.remove_style_pseudo_class('overview'), + this); Main.layoutManager.panelBox.add_child(this); Main.ctrlAltTabManager.addGroup(this,